<HTML>
<HEAD>
<TITLE>[Chapter 22] ImageObserver</TITLE>
<META NAME="author" CONTENT="John Zukowski">
<META NAME="date" CONTENT="Thu Jul 31 15:25:22 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="Java AWT">
<META NAME="title" CONTENT="Java AWT">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java AWT" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch22_07.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 22<br>java.awt.image Reference</FONT></B></TD>
<td width=172 align=right valign=top><A HREF="ch22_09.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<DIV CLASS=refnamediv>
<H1>ImageObserver</H1>

<H2>Name</H2>

ImageObserver

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.46"></A></h2>
</DIV>


<p>
<img align=middle src="./figs/imageob.gif" alt="[Graphic: Figure from the text]" width=503 height=53 border=0>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.47">Description</A></h2>

<P CLASS=para>
<tt CLASS=literal>ImageObserver</tt> is an interface 
that provides constants and the callback mechanism to receive asynchronous 
information about the status of an image as it loads. 

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.48">Interface Definition</A></h2>

<DIV CLASS=screen>
<P>
<PRE>
public abstract interface java.awt.image.ImageObserver {
  // Constants
  public static final int ABORT;
  public static final int ALLBITS;
  public static final int ERROR;
  public static final int FRAMEBITS;
  public static final int HEIGHT;
  public static final int PROPERTIES;
  public static final int SOMEBITS;
  public static final int WIDTH;
  // Interface Methods
  public abstract boolean imageUpdate (Image image, int infoflags, 
     int x, int y, int width, int height);
}
</PRE>
</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.49">Constants</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.60">ABORT</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.65">public static final int ABORT</A></h4>

<P CLASS=para>
The <tt CLASS=literal>ABORT</tt> flag indicates that 
the image aborted during loading. An attempt to reload the image may succeed, 
unless <tt CLASS=literal>ERROR</tt> is also set. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.61">ALLBITS</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.66">public static final int ALLBITS</A></h4>

<P CLASS=para>
The <tt CLASS=literal>ALLBITS</tt> flag indicates 
that the image has completely loaded successfully. The <tt CLASS=literal>x</tt>, 
<tt CLASS=literal>y</tt>, <tt CLASS=literal>width</tt>, 
and <tt CLASS=literal>height</tt> arguments to <tt CLASS=literal>imageUpdate()</tt> 
should be ignored. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.62">ERROR</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.67">public static final int ERROR</A></h4>

<P CLASS=para>
The <tt CLASS=literal>ERROR</tt> flag indicates that 
an error happened during the image loading process. An attempt to reload 
the image will fail. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.63">FRAMEBITS</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.68">public static final int FRAMEBITS</A></h4>

<P CLASS=para>
The <tt CLASS=literal>FRAMEBITS</tt> flag indicates 
that a complete frame of a multi-frame image has loaded. The <tt CLASS=literal>x</tt>, 
<tt CLASS=literal>y</tt>, <tt CLASS=literal>width</tt>, 
and <tt CLASS=literal>height</tt> arguments to <tt CLASS=literal>imageUpdate()</tt> 
should be ignored. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.64">HEIGHT</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.69">public static final int HEIGHT</A></h4>

<P CLASS=para>
The <tt CLASS=literal>HEIGHT</tt> flag indicates that 
the height information is available for an image; the image's height 
is in the <tt CLASS=literal>height</tt> argument to 
<tt CLASS=literal>imageUpdate()</tt>. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.65">PROPERTIES</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.70">public static final int PROPERTIES</A></h4>

<P CLASS=para>
The <tt CLASS=literal>PROPERTIES</tt> flag indicates 
that the properties information is available for an image. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.66">SOMEBITS</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.71">public static final int SOMEBITS</A></h4>

<P CLASS=para>
The <tt CLASS=literal>SOMEBITS</tt> flag indicates 
that the image has started loading and some pixels are available. The bounding 
rectangle for the pixels that have been delivered so far is indicated by 
the <tt CLASS=literal>x</tt>, <tt CLASS=literal>y</tt>, 
<tt CLASS=literal>width</tt>, and <tt CLASS=literal>height</tt> 
arguments to <tt CLASS=literal>imageUpdate()</tt>. 

</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.67">WIDTH</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.72">public static final int WIDTH</A></h4>

<P CLASS=para>
The <tt CLASS=literal>WIDTH</tt> flag indicates that 
the width information is available for an image; the image's width 
is in the <tt CLASS=literal>width</tt> argument to 
<tt CLASS=literal>imageUpdate()</tt>. 

</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.50">Interface Methods</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.68">imageUpdate</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.73">public abstract boolean imageUpdate (Image image, int infoflags, int x, int y, int width, int height)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>image</I><br>
<DD>

<P CLASS=para>
Image that is being loaded.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>infoflags</I><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>ImageObserver</tt> 
flags for the information that is currently available.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>x</I><br>
<DD>

<P CLASS=para>
Meaning depends on <tt CLASS=literal>infoflags</tt> 
that are set.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>y</I><br>
<DD>

<P CLASS=para>
Meaning depends on <tt CLASS=literal>infoflags</tt> 
that are set.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>width</I><br>
<DD>

<P CLASS=para>
Meaning depends on <tt CLASS=literal>infoflags</tt> 
that are set.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>height</I><br>
<DD>

<P CLASS=para>
Meaning depends on <tt CLASS=literal>infoflags</tt> 
that are set. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>true</tt> if image has completed 
loading (successfully or unsuccessfully), <tt CLASS=literal>false</tt> 
if additional information needs to be loaded. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Provides the callback mechanism for the asynchronous loading of images. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.51">See Also</A></h2>

<P CLASS=para>
<tt CLASS=literal>Component</tt>, <tt CLASS=literal>Image</tt>, 
<tt CLASS=literal>Object</tt> 

</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch22_07.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top><A HREF="ch22_09.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>ImageFilter</td>
<td width=171 align=center valign=top><a href="index/idx_a.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>ImageProducer</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
